Docker

Learn about the Docker Toolbox and Community Edition for macOS and Windows, as well as Docker.

As we’ve discussed, the low-level container capabilities of Linux were available but required highly specialized expertise to use. A team at a company called dotCloud started an internal, proprietary project to wrap these low-level features with a more accessible toolset. That team released Docker as open source in March 2013, then started Docker, Inc. to continue its development.

Docker was developed to democratize the container features of Linux, providing a high-level command-line interface (CLI) and application programming interface (API) to define, run, and manage containers. The CLI and API provide tools to run and manage containers without the need to know the detailed inner workings of the Linux kernel extensions that support them.

At the time of this writing, there are three ways to run Docker:

Docker Toolbox for macOS and Windows#

Docker Toolbox is a collection of tools that include:

  • Docker Engine: This is the core Docker program.
  • Docker Machine: This is a tool for managing Docker containers on remote hosts.
  • Docker Compose: This is a tool for defining related groups of containers to support multicontainer applications.
  • Kitematic: This is an alpha-version graphical UI used to manage Docker containers.
  • Oracle VirtualBox: This is a hypervisor used to run virtual machines on macOS and Windows.
  • Customized Docker shell: This is a command-line shell interface used to execute Docker commands.

Those who’ve installed Docker Toolbox on Windows or macOS (or just read the list above) may have noticed that it installs VirtualBox, a hypervisor developed by Oracle. Docker Betas for macOS and Windows also require virtual machines. It’s reasonable to wonder why, if containers aren’t virtual machines, all macOS and Windows versions of Docker use some form of the hypervisor. The reason is that Windows and macOS don’t support containers directly. Docker Toolbox installs a Linux-based virtual machine, and that’s where the containers are run. The command-line Docker tools connect to the Linux VM in the background to work with the containers.

Container
Container
Container
Container
Container
Container
Linux VM
Linux VM
Docker Toolbox
Docker Toolbox
Mac/PC
Mac/PC
Viewer does not support full SVG 1.1
Docker Toolbox uses a VM to run containers

Even in cases where an OS natively supports containers, it’s necessary to use a hypervisor and VM to run containers based on a different kernel. For example, in order to run Linux containers on a Windows system (or vice versa), a VM must be used. This is due to the fact that containers share the host kernel. It’s not possible to run a Linux container directly on a Windows host, or vice versa, because they’re based on different kernels.

Docker Community Edition for macOS/Windows#

Docker Community Edition (CE) for Windows and macOS provides the native versions of the Docker programs (Docker Engine, Compose, Machine, and so on) that run directly on Windows and macOS. They still use a Linux VM to run containers, but they use alternative hypervisors (not VirtualBox). Docker CE for Windows uses Microsoft Hyper-V, which is supported by hardware extensions built into Intel and AMD CPUs. Docker CE for macOS uses xhyve, a lightweight software hypervisor based on an open-source hypervisor for BSD and Linux.

Docker on linux#

Docker runs natively on Linux distributions. No additional applications, such as hypervisors or custom shells, are needed to run Docker on Linux. Linux containers run natively on Linux hosts. The container extensions that support containers are available on all open-source versions of Linux. Some enterprise versions of Linux, such as Red Hat, also support containers.

Containers

Containers and DevOps